package com.caiheng.api.service.examine;

import cn.hutool.json.JSONArray;
import com.caiheng.api.entity.examine.ExamineApprove;
import com.caiheng.api.entity.examine.ExamineApproveRegRecord;
import com.caiheng.api.entity.sys.SysUser;
import com.caiheng.api.entity.wxuser.User;
import com.caiheng.api.service.base.BaseService;

import java.util.List;

/**
 * 审批申请记录Service接口
 *
 * @author ruoyi
 * @date 2022-11-23
 */
public interface ExamineApproveRegRecordService extends BaseService<ExamineApproveRegRecord> {

    /**
     *  查看详情
     * @return
     */
    ExamineApproveRegRecord getDetail(int userId, int recordId);

    /**
     *  添加发起审批
     * @param user
     * @param regRecord
     * @return
     */
    int addRecord(User user, ExamineApprove approve, ExamineApproveRegRecord regRecord, JSONArray regInfos, SysUser sysUser);

    /**
     *  修改发起审批
     * @param user
     * @param regRecord
     * @return
     */
    int updateRecord(User user, ExamineApprove approve, ExamineApproveRegRecord regRecord, JSONArray regInfos, SysUser sysUser);

    /**
     *  撤销审批
     * @param user
     * @param regRecord
     * @return
     */
    int cancelRecord(User user, ExamineApproveRegRecord regRecord);

    /**
     *  我的申请列表
     * @param user
     * @param approveType
     * @param pageIndex
     * @param pageSize
     * @return
     */
    List<ExamineApproveRegRecord> getMyRegRecordList(User user,int approveType ,int pageIndex, int pageSize);

    /**
     *  我的申请列表
     * @param user
     * @param state
     * @param pageIndex
     * @param pageSize
     * @return
     */
    List<ExamineApproveRegRecord> getMyRegRecordListByState(User user,int state ,int pageIndex, int pageSize);

    /**
     *  我的申请列表
     * @param user
     * @param approveType
     * @param pageIndex
     * @param pageSize
     * @return
     */
    List<ExamineApproveRegRecord> getAdminHandleList(User user, int approveType ,int pageIndex, int pageSize);

    /**
     *  我的申请列表（不区分类型）
     * @param user
     * @param pageIndex
     * @param pageSize
     * @return
     */
    List<ExamineApproveRegRecord> getAdminHandleListByState(User user, int state,String searchValue,  int pageIndex, int pageSize);


    /**
     *  抄送列表
     * @param user
     * @param pageIndex
     * @param pageSize
     * @return
     */
    List<ExamineApproveRegRecord> getAdminCopyListByState(User user, int state, String searchValue, int pageIndex, int pageSize);


    /**
     * 获取待审核的数量
     * @param user
     * @param state
     * @return
     */
    int getAdminHandleCount(User user, int state);
}
